
#ifndef _BTL_POWERON_H_
#define _BTL_POWERON_H_


#include "app_init.h"

enum
{
    BTL_ERR_OK = 0,
    BTL_ERR_NEED_NOT_UPDATE,    //固件已是最新，不需要更新
    BTL_ERR_FW_UPDATED,         //固件已完成更新
    BTL_ERR_IIC_COM_FAIL,       //IIC通讯错误
    BTL_ERR_CHIPID_UNMATCHED,   //CHIPID未检测到
    BTL_ERR_BIN_FMT_INVALID,    //BIN文件格式不对
    BTL_ERR_VER_READ_FAIL,      //读TP版本错误
    BTL_ERR_UPDATE_FAIL,        //更新固件失败
    BTL_ERR_CHECKSUM_FAIL,      //更新完后，校验和检测错误
};

//custom used
#define BTL_FW_BIN      NULL//fwbin       //tp¹Ì¼þµÄÊý×é
#define BTL_FW_BIN_LEN  WN8012_TP_DATA_MAX_LENGTH//sizeof(fwbin)//tp¹Ì¼þµÄÊý×éµÄ´óÐ¡
#define BTL_IIC_ADDR    0x2c         //tpµÄµØÖ·

//²Ù×÷IICµÄ¶ÁÐ´½Ó¿Ú
#define BTL_I2CSendRecv(wBuf, wLen, rBuf, rLen)   BTL_I2CSendRecvEx(BTL_IIC_ADDR, wBuf, wLen, rBuf, rLen)


//ÏµÍ³µÄÑÓ³Ù½Ó¿Ú£¬µ¥Î»ms
#define BTL_DelayMs(ms) delay_ms(ms)
//LOG´òÓ¡½Ó¿Ú£¬¿É²»ÓÃ
#define TP_LOG_PRINTF(...)  printf(__VA_ARGS__)

uint8_t BTLTpPowerOnCheck(void);

#endif

